
; ----------------------------------------------
;  Uno Tag System ver. 2.5 by UnoShe
; ----------------------------------------------
;
; Updated - 12/02/12
;
;
; - PLEASE GIVE CREDIT IF MODIFYING THIS..

; --- Entering the screen ---
[Statedef 4901]
type = A
movetype = I
physics = N
sprpriority = 2
ctrl = 0

[State 4901, ChangeAnim]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(selfanimexist(45),45,42)

[State 4901, turn]
type = turn
triggerall = IsHelper(4901)
trigger1 = time = 0
trigger1 = facing != Root, facing

[state 4901, labo]
type = Null
trigger1 = IsHelper(4901)
trans = addalpha
alpha = 160,90

[State 0, AssertSpecial]
type = AssertSpecial
triggerall = IsHelper(4901)
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 4912, pos]
type = posset
triggerall = Time = 0
triggerall = !IsHelper(4901)
trigger1 = (partner, stateno = 4925)
trigger2 = (partner, prevstateno = 4910)
trigger3 = (partner, stateno = 4928)
x = -243*facing
y = ((partner, backedgebodydist)*-1)/2

[State 4901, helper_pos]
type = PosSet
triggerall = IsHelper(4901)
trigger1 = time = 0
x = -243*facing
y = ((abs(Root, pos y) + Root, backedgebodydist)*-1)/2

[State 4901, VelSet]
type = VelSet
trigger1 = partner, var(51) = 1 || partner, var(51) = 9 || (Partner, var(51) = 2 && partner, stateno = 4925)
trigger2 = IsHelper(4901)
x = (abs(backedgedist)+abs(pos y * 2))/Cond(IsHelper(4901),10,12)
y = Cond(IsHelper(4901),(abs(Root, backedgebodydist)/25),(abs(pos y)/12))
persistent = 0

[State 4901, VelAdd]
type = VelAdd
trigger1 = !IsHelper(4901)
trigger1 = vel y < 1
y = 0.6

[State 4901, VelMul]
type = VelMul
triggerall = !IsHelper(4901) && !partner, stateno = 4925
triggerall = backedgebodydist >= 0
trigger1 = frontEdgeBodyDist <= 35
trigger2 = Pos Y > -5
trigger3 = p2statetype != A && p2bodyDist x = [-40,40]
x = ifelse((p2bodyDist x = [-45,45]),0.85,0.75)

[State 4925, PartnerPause]
type = Superpause
trigger1 = Partner, StateNo = 4925
anim = -1
time = 6
movetime = 6
darken = 0
persistent = 0

[State 4901, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 2 

[State 4901, offME]
type = NotHitBy
trigger1 = Partner, var(51) = 6
trigger2 = Partner, stateno = 4928 || Partner, prevstateno = 4928
value = SCA
time = 15

[State 4901, invin]
type = NotHitBy
trigger1 = Partner, Life <= 0
value = SCA
time = 6

[State 4901, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4901, 9]
type = VelSet
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
x = 0
y = 0

[State 4901, Gone]
type = DestroySelf
triggerall = Ishelper(4901)
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
trigger2 = Root, Facing = 1 && Pos x >= Root, pos x - 45
trigger3 = Root, Facing = -1 && Pos x <= Root, pos x + 45

[State 4901, 10]
type = ChangeState
triggerall = !IsHelper(4901)
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
value = 4921

; --- Tag Aerial Attack(CA) ---
[Statedef 4902]
type = A
movetype = A 
physics = N
sprpriority = 2
anim = ifelse(selfanimexist(45),45,42)
poweradd = -1000
ctrl = 0

[State 4902, PalFX]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

; Define this if necessary...
[State 4902, Aerial Attack Anim]
type = ChangeAnim
trigger1 = p2bodydist x = [0,185]		; <---| ..in case aerial-attack does not hit properly because of the animation loop doesn't fit the speed of the character's entrance, you can adjust this range to fit your character's attack.
value = 4902		; <---|[KICK]
persistent = 0

[State 4902, ChangeAnim2]
type = ChangeAnim
trigger1 = Numtarget = 0
trigger1 = (Anim != [42,45]) && AnimTime = 0
trigger1 = frontEdgeBodyDist <= 35
value = ifelse(selfAnimExist(45),45,44)
persistent = 0

[State -2, def]
type = VarSet
trigger1 = 1
v = 51
value = 9

[State 4902, pos]
type = Posset
trigger1 = time = 0
x = -223*facing
y = ((abs(enemynear, frontedgedist + 25)/2.5) + Cond((enemynear, statetype = A),abs(enemynear, pos y * 1.6),abs(enemynear, pos y * 1.2)))*-1

[State 4902, velocity]
type = VelSet
trigger1 = frontedgedist >= 0
x = (19 + abs(backedgebodydist) + abs(pos y *2.25) - abs(enemynear, pos y*2))/20 
y = (abs(pos y + 5) )/20	;(abs(pos y + 5) - abs(enemynear, pos y))/20
persistent = 0

[State 4902, VelAdd]
type = VelAdd
trigger1 = enemynear, frontedgebodydist = [0,50]
x = 2.5
y = 0.45
persistent = 0

[State 4902, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 2

[State 4902, invin]
type = NotHitBy
trigger1 = Partner, Life <= 0
value = SCA
time = 6

[State 4902, sb] 
type = ScreenBound
trigger1 = 1
value = 1

[State 4902, hit]
type                    = HitDef
trigger1                = !(NumTarget)
attr                    = A, SA
damage                  = 5, 1
animtype                = heavy
air.animtype 			= back
fall.animtype			= Up
guardflag               = HA
hitflag                 = MAFD
priority                = 5, Hit
pausetime               = 11, 23
sparkxy                 = -10, -80
hitsound                = 5,2
guardsound              = 6,0
ground.type             = High
ground.slidetime        = 3
ground.hittime          = 30
ground.velocity         = -0.25, 0
airguard.velocity       = -3.5, -1.85
air.type                = high
air.velocity            = -2.25, -6.25
air.hittime             = 50
getpower                = 0
givepower      			= 15
fall                    = 0
fall.recover            = 0
air.fall                = 0
air.recover             = 0
guard.kill = 0

[State 4902, NoJC]     
type = AssertSpecial
trigger1 = 1
flag = nojugglecheck
ignorehitpause = 1

[State 4902, PaAngat]
type = TargetVelSet
triggerall = Numtarget
trigger1 = (Anim != [42,45])
trigger1 = MoveHit
trigger1 = (Target, Statetype = A && Target, Pos Y >= -10 ) || Target, Statetype = L
x = ifelse((Target, Statetype = A && target, GetHitVar(xvel) > -1),-4.2, -1.5)
y = -4.15
persistent = 0

[State 4902, Bigat]
type = Gravity
trigger1 = Numtarget
trigger1 = Target, Statetype = A
trigger1 = Movecontact
trigger2 = p2dist x < 0 
trigger2 = Numtarget = 0
trigger2 = frontEdgeBodyDist <= 30
trigger3 = !Movecontact
trigger3 = p2BodyDist x = [-10,10]
trigger4 = !Movecontact
trigger4 = frontEdgeBodyDist <= 30

[State 4902, CtrlSet]
type = CtrlSet
triggerall = backedgebodydist >=0
trigger1 = movecontact
value = 1
ignorehitpause = 1

[State 4902, VelMul]
type = VelMul
triggerall = Numtarget
triggerall = backedgebodydist > 0
trigger1 = Movetype = A
trigger1 = movecontact
trigger1 = p2bodydist x <= 15
trigger2 = frontedgebodydist <= 35
trigger3 = p2bodydist x = [0,7]
x = ifelse(frontEdgeBodyDist <= 35,0.37,ifelse((NumTarget && Target, statetype =A),0.87,0.8))

[State 4902, VelAdd]
type = VelAdd
triggerall = Numtarget
triggerall = backedgebodydist > 0
trigger1 = Movetype = A
trigger1 = movecontact
trigger3 = p2bodydist x >= -10
trigger2 = frontedgebodydist <= 35
trigger3 = p2bodydist x = [-10,10]
y = ifelse((NumTarget && Target, statetype =A),0.35,1.15)
persistent = 0

[State 4902, VelAdd]
type = PlayerPush
trigger1 = Movetype = A
trigger1 = movecontact
value = 1

[State 4902, StateTypeSet]
type = StateTypeSet
trigger1 = movecontact
type = A
physics = A
presistent = 0

[State 4902, 9]
type = VelSet
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
trigger1 = AnimElem = 2, >= 0
x = 0
y = 0

[State 4902, 10]
type = VarSet
trigger1 = NumPartner && !Time
var(5) = partner,Var(5)

[State 4902, 11]
type = ChangeState
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
trigger1 = AnimElem = 2, >= 0
value = 4921


; --- Saving Shift Attack ---
[Statedef 4903]
type = A
movetype = A
physics = N
anim = ifelse(selfanimexist(45),45,42)
sprpriority = 3
poweradd = -500
ctrl = 0

[State 4903, pos]
type = Posset
trigger1 = !IsHelper(4903) && !Ishelper(4904)
x = -243*facing
y = abs(enemynear, frontedgedist +  abs(enemynear, pos y) + 19)/2.35*-1
persistent = 0

[State 4903, turn]
type = Turn
triggerall = time = 0
trigger1 = Ishelper(4903)
trigger1 = facing = 1 && enemy(1), pos x < pos x
trigger2 = Ishelper(4903)
trigger2 = facing = -1 && enemy(1), pos x > pos x
trigger3 = Ishelper(4904) && Facing = helper(4903), facing

[State 4903, posH]
type = Posset
trigger1 = IsHelper(4903) || Ishelper(4904) 
x = Root,pos x
y = enemynear, pos y
persistent = 0

[State 4903, invi]
type = AssertSpecial
trigger1 = IsHelper(4903) || Ishelper(4904)
flag = invisible
flag2 = noshadow
flag3 = unguardable
ignorehitpause = 1

; Define this if necessary...
[State 4903, Aerial Attack Anim]
type = ChangeAnim
trigger1 = p2bodydist x = [0,185]		; <---| ..in case aerial-attack does not hit properly because of the animation loop doesn't fit the speed of the character's entrance, you can adjust this range to fit your character.
trigger1 = Anim != 640		; <---|[KICK]
value = 640		; <---|[KICK]

[State 4903, res]
type = ChangeAnim
trigger1 = IsHelper(4903) || Ishelper(4904)
trigger1 = NumTarget
value = 42
persistent = 0

[State 4903, Epeks]
type = Null
trigger1 = !IsHelper(4903) && !IsHelper(4904)
time = 12
trans = add
PalContrast =  150, 150, 150
PalBright = 20,20,20
time    =  -1
length  = 19
TimeGap = 1
FrameGap = 2
persistent = 0

[State 4903, vel]
type = VelSet
trigger1 = !IsHelper(4903) && !IsHelper(4904)
trigger1 = frontedgedist >= 0
x = (abs((pos y - abs(enemynear, pos y)) *2.5))/12
y = (abs(pos y)/14)
persistent = 0

[State 4903, velH]
type = VelSet
trigger1 = IsHelper(4903) || IsHelper(4904)
x = (1.5+Time*1.5)
y = 0.1

[State 4903, VelAdd]
type = VelAdd
trigger1 = !IsHelper(4903) && !IsHelper(4904)
trigger1 = enemynear, frontedgebodydist = [0,50]
x = 2.1
y = -0.35
persistent = 0

[State 4903, VelAdd2]
type = VelAdd
trigger1 = backedgebodydist > 0
trigger1 = !MoveContact
x = 0.55

[State 4903, pause]
type = Superpause
trigger1 = time = [1,2]
anim = -1
time = 6
movetime = 4
darken = 0
p2defmul = 1

[State 4903, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4903, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4903, hit]
type                    = HitDef
trigger1                = !NumTarget
attr                    = A, SA
damage                  = ifelse(Ishelper(4903) || Ishelper(4904),0,2),0
animtype                = diagup
hitflag                 = MAFD
priority                = 7, Hit
pausetime               = 12, 14
sparkxy                 = -10, -80
hitsound                = 5,4
guardsound              = 6,0
ground.type             = High
ground.slidetime        = 2
ground.hittime          = 25
ground.velocity         = -4.25,-8.4
airguard.velocity       = -3.9,-1.7
air.type                = high
air.velocity            = -4.35,-7.5
air.hittime             = 20
getpower                = 0
givepower      			= 10
fall                    = 1
fall.recover            = 0
air.fall                = 1
air.recover             = 0
numhits = 0
persistent = 0

[State 4903, Vel1]
type = VelMul
triggerall = !IsHelper(4903) && !IsHelper(4904)
trigger1 = movecontact
trigger2 = frontedgebodydist <= 20
x = ifelse((p2dist x = [0,15]),0.7,0.85)

[State 4903, Bigat]
type = Gravity
triggerall = !IsHelper(4903) && !IsHelper(4904)
trigger1 = Movecontact
trigger2 = frontEdgeBodyDist <= 20

[State 4903, 9]
type = VelSet
triggerall = !IsHelper(4903) && !IsHelper(4904)
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
trigger1 = AnimElem = 2, >= 0
x = 0
y = 0

[State 4903, 10]
type = ChangeState
triggerall = !IsHelper(4903) && !IsHelper(4904)
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
trigger1 = AnimElem = 2, >= 0
value = 4921

[State 4903, X]
type = DestroySelf
triggerall = IsHelper(4903) || IsHelper(4904)
trigger1 = frontEdgeDist <= 0
trigger2 = NumTarget = NumEnemy
trigger3 = Time > 3*TicksPerSecond


; Partner Assist (Pasok sa scene)
[Statedef 4904]
type = A
movetype = A
physics = N
anim = ifelse(selfanimexist(45),45,42)
poweradd = -500
sprpriority = 2
ctrl = 0

[State -2, def]
type = VarSet
trigger1 = 1
v = 51
value = 8

[State 4904, Turn]
type = Turn
trigger1 = Time = 0
trigger1 = Facing != Partner, Facing

[State 4904, InitPos]
type = posset
trigger1 = time = [0,1]
x = -343*facing
y = ((partner, backedgebodydist)*-1)/2
persistent = 0

[State 4904, Vel]
type = VelSet
trigger1 = partner, var(51) = 1 || partner, var(51) = 9
trigger2 = Time = [1,2]
x = (abs(backedgedist)+abs(pos y * 2))/12
y = (abs(pos y )/12)
persistent = 0

[State 4904, VelMulClose]
type = VelMul
triggerall = Pos Y < 0
triggerall = BackEdgeBodyDist >= 0
trigger1 = frontEdgeBodyDist = [0,35]
trigger2 = p2BodyDist x <= 20
x = 0.6

[State 4904, VelAdd]
type = VelAdd
trigger1 = vel y < 1
y = 0.6

[State 4904, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 2

[State 4904, invin]
type = NotHitBy
trigger1 = Partner, Life <= 0
value = SCA
time = 6

[State 4904, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4904, 9]
type = VelSet
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
x = 0
y = 0

[State 4904, VarSet]
type = VarSet
trigger1 = !Time
var(53) = 1 

[State 4904, End]
type = ChangeState
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
value = 4921


; PARTNER ASSIST - Melee Option
[Statedef 4905]
type = S
movetype = A
physics = S
anim = 100	; <---| You can use the standard running animation or put another one
sprpriority = 2
ctrl = 0
facep2 = 1

[State 4905, pos]
type = PosSet
trigger1 = 1
y = 0

[State 4905, vel]
type = VelSet
trigger1 = Anim != 4905
x = 9

[State 4905, vel2]
type = VelSet
trigger1 = Anim = 4905
trigger1 = AnimElem = 2, >= 0
x = 7.5

[State 4905, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 3

[State 4905, invin_not]
type = HitBy
trigger1 = BackEdgeBodyDist > 0
value = SCA, AA, AP

[State 4905, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4905, attack]
type = ChangeState
triggerall = BackEdgeBodyDist >= 0
trigger1 = partner, life > 0
trigger1 = P2BodyDist X <= 25
trigger1 = !Win && !Lose
value = 4933

[State 4905, 3]
type = VelSet
triggerall = BackEdgeBodyDist >= 0
trigger1 = FrontEdgeBodyDist <= 10
trigger2 = partner, life <= 0
trigger2 = (Time >= 50) || (P2BodyDist X = [-100, 100])
trigger3 = P2Dist X < 0
trigger4 = P2BodyDist X = [-100, 100]
trigger4 = Win
trigger5 = Win
trigger5 = Time >= 20
x = 0
y = 0

[State 4905, attack]
type = ChangeState
triggerall = BackEdgeBodyDist >= 0
trigger1 = FrontEdgeBodyDist <= 0
trigger2 = Partner, Life <= 0
trigger2 = (Time >= 50) || (P2BodyDist X = [-100, 100])
trigger3 = P2Dist X < 0
trigger4 = P2BodyDist X = [-20, 20]
trigger5 = Win
trigger5 = Time >= 20
trigger6 = P2BodyDist X = [-100, 100]
trigger6 = Win
value = 4933

[State 4905, PartnerKOed_vel]
type = Velset
trigger1 = BackEdgeBodyDist > 0
trigger1 = !Partner, Alive
x = 0
y = 0

[State 4905, PartnerDead]
type = ChangeState
trigger1 = BackEdgeBodyDist > 0
trigger1 = !Partner, Alive
value = 0
ctrl = 1


; ----- "UNO MODE" ACTIVATE -----
[Statedef 4906] 
type = S
movetype = I
physics = S
anim = 5300		; <---|[DIZZY]
sprpriority = 2
velset = 0,0
ctrl = 0

[State 4906, PartnerDead]
type = CtrlSet
trigger1 = 1
value = 0

[State 4906, pos]
type = PosSet
trigger1 = Time = [0,1]
x = Partner, pos x
y = 0

[State 4906, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 4906, helper]
type = helper
trigger1 = Partner, StateNo = [5110,5150]
trigger2 = Partner, PrevStateNo = 4929 && AnimElem >= 11
helpertype = Normal
ID = 4907
stateno = 4907
name = "Uno"
;pos = 0,0
;postype = p1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4906, hit1]
type = helper
trigger1 = !NumHelper(4903)
helpertype = Normal
ID = 4903
stateno = 4903
name = "Hit"
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4906, hit2]
type = helper
trigger1 = !NumHelper(4904)
helpertype = Normal
ID = 4904
stateno = 4903
name = "Hit2"
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4906, stoptime]
type = AssertSpecial
trigger1 = NumHelper(4907)
flag = timerfreeze

[State -2, def]
type = VarSet
triggerall = !NumHelper(4907)
trigger1 = Partner, StateNo = [5110,5150]
v = 51
value = 7

[state 4906, LIFE]
type = LifeAdd
trigger1 = time = [0,1]
value = LifeMax

[state 4906, disappear]
type = Trans
trigger1 = NumHelper(4907)
trigger1 = Helper(4907), Time > 0
trans = add1

[State 4906, PartnerPause]
type = Superpause
trigger1 = NumHelper(4907)
time = 5
anim = -1
sound = -1
;move = 1
movetime = 5
darken = 0
p2defmul = 0.5
unhittable = 1
pausebg = 1 ;(winmugen only)

[State 4906, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4906, ghost] 
type = PlayerPush
trigger1 = 1
value = 0

[State 4906, End]
type = ChangeState
trigger1 = Time > 0
trigger1 = var(51) = 7 && !NumHelper(4907) && !NumHelper(4908)
trigger1 = Partner, StateNo = 4913 || Partner, StateNo = [5110,5150]
value =5300
ctrl = 1


; --- UNO Mode: Alter Nega Ego ---
[Statedef 4907]
type = S
movetype = I
physics = S
anim = 195		; <---|[EX_TAUNT]
sprpriority = 5
velset = 0,0
ctrl = 0

[State 4907, voice]	; <---| Define your taunt voice here..
type = PlaySnd
trigger1 = IsHelper(4908) && !Time
value = 195,0
channel = 0
pan = (Time*0.5)

[State 4907, helper]
type = helper
triggerall = !IsHelper(4909)
trigger1 = AnimElem >= 3 || Time = [3,4]
helpertype = Normal
ID = ifelse(ishelper(4908),4909,4908)
stateno = 4907
name = "She"
;pos = 0,0
;postype = p1
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4907, Nega]
type = PalFx
trigger1 = 1
time = 9
invertall = 1
color = 256 - Time*3

[State 4907, pos]
type = PosSet
trigger1 = 1
x = Root, Pos x
y = 0

[state 4907, labo]
type = Trans
trigger1 = IsHelper(4907)
trans = addalpha
alpha = 150-time*3, 210+(Time*Time*0.5)

[state 4907, labo2]
type = Trans
trigger1 = !IsHelper(4907)
trans = addalpha
alpha = 256-time*2, 25+(Time*Time*0.65)

[State 4907, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4907, draw]
type = angledraw
trigger1 = !(IsHelper(4907))
scale = ifelse(Time <= 40,1.95 - (Time*0.023),1.03), ifelse(Time <= 40,1.95 - (Time*0.023),1.03)

[State 4907, end]
type = DestroySelf
triggerall = AnimTime = 0
trigger1 = Root, NumHelper(4908)
trigger2 = IsHelper(4909)

; Partner Assist (Pasok sa scene)
[Statedef 4908]
type = A
movetype = A
physics = N
anim = ifelse(selfanimexist(45),45,42)
poweradd = -500
sprpriority = 2
ctrl = 0

[State -2, def]
type = VarSet
trigger1 = 1
v = 51
value = 8

[State 4908, Turn]
type = Turn
trigger1 = Time = 0
trigger1 = Facing != Partner, Facing

[State 4908, InitPos]
type = posset
trigger1 = time = [0,1]
x = -343*facing
y = ((partner, backedgebodydist)*-1)/2
persistent = 0

[State 4908, Vel]
type = VelSet
trigger1 = partner, var(51) = 1 || partner, var(51) = 9
trigger2 = Time = [1,2]
x = (abs(backedgedist)+abs(pos y * 2))/12
y = (abs(pos y )/12)
persistent = 0

[State 4908, VelMulClose]
type = VelMul
triggerall = Pos Y < 0
triggerall = BackEdgeBodyDist >= 0
trigger1 = frontEdgeBodyDist = [0,35]
trigger2 = p2BodyDist x <= 20
x = 0.6

[State 4908, VelAdd]
type = VelAdd
trigger1 = vel y < 1
y = 0.6

[State 4908, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 2

[State 4908, invin]
type = NotHitBy
trigger1 = Partner, Life <= 0
value = SCA
time = 6

[State 4908, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4908, 9]
type = VelSet
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
x = 0
y = 0

[State 4904, VarSet]
type = VarSet
trigger1 = !Time
var(53) = 1 

[State 4908, End]
type = ChangeState
trigger1 = Vel Y >= 0
trigger1 = Pos Y >= 0
value = 4922

; Leaving Taunt
[Statedef 4910]
type = S
movetype = I
physics = S
anim = 1		; <---|[TAUNT]
sprpriority = -2
velset = 0,0
facep2 = 1
ctrl = 0

[State 700, 1]
type = Null
trigger1 = AnimElem = 2
value = 0, 0

[State 700, 1]
type = Null
trigger1 = Anim = 700 && AnimElem = 1
value = F4910, 0

[State 4910, NoTauntAnim]
type = ChangeAnim 		; <---| Change this to "NULL" if you have already defined your taunt.
trigger1 = Time = 0
trigger1 = !selfanimexist(195)
value = 40
persistent = 0

[State 4910, pos]
type = PosSet
trigger1 = 1
y = 0

[State 4910, drop]
type = TargetDrop
trigger1 = NumTarget && var(51) = 8

[State 4910, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 10
persistent = 0

[State 4910, ghost] 
type = PlayerPush
trigger1 = 1
value = ifelse(Var(51) = 8,0,1)

[State 4910, NotHitBy]
type = NotHitBy
triggerall = NumPartner
trigger1 = var(51) = 8
value = SCA

[State 4910, sb]
type = ScreenBound
triggerall = NumPartner
trigger1 = var(51) = 8
value = 0

[State 4910, end state]
type = ChangeState
triggerall = RoundState > 1
trigger1 = Time = [26,27]
trigger2 = Animtime = 0
trigger3 = var(51) = 5
value = 5150

[State 4910, end of fight]
type = ChangeState
trigger1 = RoundState > 2
value = 5150
;ctrl = 1


; Leave the stage
[Statedef 4911]
type = S
movetype = I
physics = N
velset = 0,0
sprpriority = -2
ctrl = 0

[State -2, VarSet]
type = VarSet
trigger1 = var(51) = 5
v = 51
value = 1

[State 4911, AfterImageTime]
type = Null
trigger1 = 1
time = 0

[State 4911, ChangeAnim]
type = ChangeAnim
triggerall = Anim != [40,43]
trigger1 = prevstateno = 4910
trigger2 = prevstateno = 4926
trigger3 = partner, stateno = 4903 || partner, prevstateno = 4903
trigger4 = var(51) = 2
trigger5 = partner, stateno = [4932,4931]
trigger6 = partner, stateno = [1000,4000]
trigger7 = var(51) = 4
trigger8 = var(51) = 8
value = 40
persistent = 0

[State 4911, anim]
type = ChangeAnim
trigger1 = Anim = 40 && AnimTime = 0
value = ifelse(var(51) = 8,43,42)
persistent = 0

[State 4911, anim]
type = ChangeAnim
trigger1 = Anim = 40 && AnimTime = 0
trigger1 = !selfanimexist(42)
trigger1 = !selfanimexist(43)
value = 41
persistent = 0

[State 4911, statetype]
type = StateTypeSet
TriggerAll = AnimElem = 1
trigger1 = Anim = 42
trigger2 = Anim = 43
trigger3 = Anim = 41
statetype = A

[State 4911, Turn]
type = Turn
triggerall = Facing = Partner, Facing
trigger1 = Anim = 42 && AnimElem = 1
trigger2 = Anim = 41 && AnimElem = 1
persistent = 0

[State 4911, jumpbackvel]
type = VelSet
trigger1 = Anim = 43 && AnimElem = 1
x = -11.5
y = -6.5

[State 4911, jumpforwardvel]
type = VelSet
trigger1 = Anim = 42 && AnimElem = 1
trigger2 = Anim = 41 && AnimElem = 1
trigger3 = partner, stateno = 4903 || partner, prevstateno = 4903
x = 11.5
y = -6.85

[State 4911, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4911, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4911, sb]
type = ScreenBound
trigger1 = 1
value = 0

[State 4911, wait outside state]
type = ChangeState
trigger1 = backedgebodydist < -30
trigger2 = frontedgebodydist < -30
trigger3 = Time >= 35 || StateTime >= 35
value = 4912


; Standby (offscreen)
[Statedef 4912]
type = A
movetype = I
physics = N
anim = 41
velset = 0,0
ctrl = 0

[State -2, def]
type = VarSet
trigger1 = time = [0,1]
v = 51
value = 1   

[state 4912, Hide]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[State 4912, noaimg]
type = Null
trigger1 = time = [0,2]
time = 0

[State 4912, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4912, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4912, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4912, lifeAdd] ; Gains life (optional)
type = LifeAdd
triggerall = RoundState = 2
trigger1 = (gametime%10) = 0
value = 1

[State 4912, turn]
type = turn
trigger1 = facing != partner,facing

[State 4912, pos]
type = Posset
trigger1 = partner, stateno = 4926
x = -223*facing
y = ((abs(enemynear, frontedgedist + 20)/2.5) + abs(enemynear, pos y * 1.05))*-1

[State 4912, pos]
type = posset
trigger1 = partner, stateno != 4910
trigger1 = partner, stateno != 4925
trigger1 = partner, stateno != 4927
x = (partner, pos x) - 10000*facing
y = -150

[State 4912, pos_S]
type = posset
trigger1 =(partner, stateno = 4910)
x = -243*facing
y = (partner, backedgedist)*-1/2

[State 4912, VarSet]
type = Null
triggerall = NumPartner
triggerall = partner,var(51) = 1
triggerall = partner, life > 0
triggerall = power >= 500
triggerall = partner,movetype = A
triggerall = partner,stateno = [200,4850]
triggerall = (partner,stateno != [4902,4905]) && (partner,StateNo != [3000,4099])
triggerall = !(partner,Hitdefattr = A, NA, SA, HA) && !(partner,Hitdefattr = SCA, NT, ST, HT)
trigger1 = command = "palit"
var(56) = 1

[State 4912, VarSet]
type = Null
triggerall = !var(54)
triggerall = NumPartner
triggerall = partner,var(51) = 1 || partner,var(51) = 9
triggerall = RoundState = 2
triggerall = partner, life > 0
triggerall = power >= 1000
triggerall = stateno = 4912 && Time >= 10
triggerall = partner, stateno = [2000,4900]
triggerall = partner, hitdefattr = SCA, HA, HP || partner, StateNo = 3000
trigger1 = command = "sheoun"
var(57) = 1

[State 4912, Striker]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Partner, Var(51) = 10
value = 4904

[State 4912, Striker]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Partner, Var(51) = 11
value = 4908

[State 4912, diz]
type = ChangeState
trigger1 = Partner, StateNo = [4928,4929]
value = 4906
persistent = 0

[State 4912, debug]
type = ChangeState
triggerall = RoundState >= 2
trigger1 = !Partner, Life
trigger2 = Partner, StateNo = 4912
trigger2 = Life > Partner, Life
value = 4913
persistent = 0

[State 4912, debug]
type = Null
triggerall = !var(59)
trigger1 = command = "recovery"
value = 4914
persistent = 0


; Standby (Partner Dead)
[Statedef 4913]
type = A
movetype = I
physics = N
anim = 41
velset = 0,0
ctrl = 0

[state 4913, Hide]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1

[State 4913, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4913, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4913, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4913, turn]
type = turn
trigger1 = Partner, Alive && Facing != Partner, Facing
trigger2 = !Partner, Alive && Facing = Enemy, Facing

[State 4913, pos]
type = posset
trigger1 = 1
trigger1 = partner, stateno != 4910
trigger1 = partner, stateno != 4926
trigger1 = partner, stateno != 4929
x = (partner, pos x) - 1000*facing
y = -150

[State 4913, ent3r]
type = ChangeState
Triggerall = Life && !(Partner, Life)
triggerall = Partner, Time >= 30
Trigger1 = Partner, StateNo = [5110,5150]
trigger2 = Partner, StateNo = 4913
value = 4920
persistent = 0

[State 4913, p]
type = PosSet
trigger1 = RoundState > 2
trigger1 = !Alive
x = partner, pos x
y = 0

[State 4913, end]
type = ChangeState
trigger1 = RoundState > 2
trigger2 = partner, stateno = 4912
trigger3 = !Partner, Alive && Time >= (6 * TicksPerSecond)
value = ifelse((!Alive && pos x = partner, pos x), 5150,4920)

[State 4913, deb]
type = ChangeState
triggerall = RoundState = 2
trigger1 = partner, stateno != 4912
Trigger1 = Partner, Life && Life
value = 4912
persistent = 0

; Standby (Call)
[Statedef 4914]
type = A
movetype = I
physics = N
anim = 41
velset = 0,0
ctrl = 0

[State -2, def]
type = VarSet
trigger1 = time = [0,1]
v = 51
value = 1   

[state 4914, Hide]
type = AssertSpecial
trigger1 = 1
flag = noshadow
;flag2 = invisible
ignorehitpause = 1

[State 4914, noaimg]
type = Null
trigger1 = time = [0,2]
time = 0

[State 4914, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4914, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4914, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4914, lifeAdd] ; Gains life (optional)
type = LifeAdd
triggerall = RoundState = 2
trigger1 = (gametime%10) = 0
value = 1

[State 4914, turn]
type = turn
trigger1 = facing != partner,facing

[State 4914, pos]
type = Posset
trigger1 = partner, stateno = 4926
x = -223*facing
y = ((abs(enemynear, frontedgedist + 20)/2.5) + abs(enemynear, pos y * 1.05))*-1

[State 4914, pos]
type = posset
trigger1 = partner, stateno != 4910
trigger1 = partner, stateno != 4925
trigger1 = partner, stateno != 4927
x = (partner, pos x) - 10000*facing
y = -150

[State 4914, pos_S]
type = posset
trigger1 =(partner, stateno = 4910)
x = -243*facing
y = (partner, backedgedist)*-1/2

[State 4914, Speech Bubble]
type = Explod
trigger1 = !Time
anim = F4914
ID = 4914
pos = 0,100
postype = back
bindtime = -1
removetime = -2
pausemovetime = -1
scale = 2,2
sprpriority = 5
ontop = 1
ownpal = 1
removeongethit = 0

[State 4914, VarSet]
type = VarSet
trigger1 = !Time
var(55) = 1

[State 4914, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = F4914,0

[State 4914, Striker]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Partner, Var(51) = 10
value = 4904

[State 4914, Striker]
type = ChangeState
trigger1 = RoundState = 2
trigger1 = Partner, Var(51) = 11
value = 4908

[State 4914, diz]
type = ChangeState
trigger1 = Partner, StateNo = [4928,4929]
value = 4906
persistent = 0

[State 4914, debug]
type = ChangeState
triggerall = RoundState >= 2
trigger1 = !Partner, Life
trigger2 = Partner, StateNo = 4912
trigger2 = Life > Partner, Life
value = 4913
persistent = 0

[State 4914, debug]
type = ChangeState
trigger1 = Time = 50
value = 4912
persistent = 0

; --- Target State 1 * Throwable ---
[Statedef 4916]
type = S
movetype = H
physics = S
sprpriority = 2
anim = 5012
velset = 0,0
facep2 = 1
movehitpersist = 1
hitcountpersist = 1
ctrl = 0

[state 4916, Pos]
type = PosSet
trigger1 = time = 0
y = 0

[State 4916, TargetFace]
type = Turn
trigger1 = Facing = Enemy, Facing

[State 4916, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 4916, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 4916, 4]
type = VelSet
trigger1 = HitOver
x = 0

[state 4916, hitplease]
type = StateTypeSet
triggerall = p2Name != "iorixi"	&& p4Name != "iorixi"	; without changing movetype with IDLE, the hyper-throw move still links with Iori's deadly rave.
trigger1 = (p2MoveType = A || enemy, movetype = A)
movetype = I

[state 4916, end]
type = ChangeState
trigger1 = Time > 30
trigger1 = AnimTime = 0
trigger2 = Time > 35
value = 4918


; --- Target State 1 * Change Attack ---
[Statedef 4917]
type = S
movetype = H
physics = C
sprpriority = 2
anim = 5012
facep2 = 1
velset = 0,0
movehitpersist = 1
hitcountpersist = 1
ctrl = 0

[State 4917, TargetFace]
type = Turn
trigger1 = Facing = Enemy, Facing

[state 4917, Pos]
type = PosSet
trigger1 = Time = [0,1]
y = 0 

[State 4917, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 0

[State 4917, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 4917, 4]
type = VelSet
trigger1 = HitOver
x = 0
y = 0

[state 4917, end]
type = ChangeState
trigger1 = Time > 30
trigger1 = AnimTime = 0
trigger2 = Time > 35
value = 4918


; --- Target State 2 ---
[Statedef 4918]
type = S
movetype = U
physics = S
sprpriority = 2
anim = 5017
velset = 0,0
ctrl = 0

[state 4918, pos]
type = PosSet
trigger1 = time = [0,1]
y = 0

[state 4918, end]
type = SelfState
trigger1 = AnimTime = 0
trigger2 = Time > 30
value = 0
ctrl = 1


; --- Target State 3 * On Air ---
[Statedef 4919]
type = A
movetype = H
physics = A
sprpriority = 2
facep2 = 1
ctrl = 0

[state 4919, addUp]
type = veladd
trigger1 = 1
y = -2.5

[state 4919, end]
type = SelfState
trigger1 = AnimTime = 0
trigger2 = Time = [1,2]
value = 5030


; Jumping in
[Statedef 4920]
type = A
movetype = I
physics = N
anim = 42
sprpriority = 2
ctrl = 0

[State 4920, turn]
type = turn
triggerall = RoundState > 2
trigger1 = facing != Partner, facing
persistent = 0

[State 4920, 0]
type = PosSet
trigger1 = AnimElem = 2, < 0
x = -243*Facing
y = 0

[State 4920, 1]
type = VelSet
trigger1 = AnimElem = 2, = 0
x = 4.35
y = -8.75
persistent = 0

[State 4920, 2]
type = NotHitBy
trigger1 = 1
value = SCA
time = 6

[State 4920, 3]
type = ScreenBound
trigger1 = 1
value = 0

[State 4920, 8]
type = Gravity
trigger1 = AnimElem = 2, >= 0

[State 4920, 9]
type = VelSet
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
trigger1 = AnimElem = 2, >= 0
x = 0
y = 0

[State 4920, 10]
type = ChangeState
trigger1 = Vel Y >= 0
trigger1 = Pos Y > 0
trigger1 = AnimElem = 2, >= 0
value = 4921

[State 4920, 11]
type = ChangeState
trigger1 = Time > 60 && BackEdgeBodyDist < 0
value = 4921


; --- Landing ---
[Statedef 4921]
type = S
movetype = I
physics = C
anim = 47
velset = 0,0
sprpriority = 2
ctrl = 0
;facep2 = 1

[State 4921, 0]
type = PosSet
trigger1 = 1
y = 0

[State 4921, EnterAgain]
type = ChangeAnim
trigger1 = BackEdgeBodyDist <= 0
value = 100

[State 4921, vel]
type = VelSet
trigger1 = BackEdgeBodyDist <= 0
x = 9

[State 4921, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 4

; Partner Assist behavior option: Define this one if you want... ^_^
; PARTNER ASSIST - the character attacks his opponent when :
[State 4921, Strike!] 
type = ChangeState
triggerall = BackEdgeBodyDist > 0
triggerall = partner, life > 0
triggerall = Pos y >= 0      
triggerall = !Win && !Lose
trigger1 = prevstateno = 4904
trigger2 = var(51) = 8
value = 4933
;value = 4905				; <---|	 ..use this value for non-projectile(or close range) Partner Assist move attack.

; TEAM HYPER ATTACK - the character attacks his opponent when :
[State 4921, RockEnRoll]
type = tagin
trigger1 = partner, stateno = 4925 && partner, Statetime > 0
trigger1 = partner, life > 0
trigger1 = Pos y >= 0       
trigger1 = !Win && !Lose
stateno = 4932
partnerstateno = 4931

[State 4921, interrupt]
type = ChangeState
triggerall = partner, var(51)= 2
trigger1 = partner, stateno != [2000,4933]
value = 4932
ctrl = 0

[State 4921, invin]
type = NotHitBy
trigger1 = var(51) != 8
trigger2 = Partner, var(51) = 6
value = SCA
time = 6

[State 4921, end]
type = ChangeState
triggerall = var(51) != 8
trigger1 = Anim = 100
trigger1 = backedgebodydist > 0
trigger2 = Anim != 100
trigger2 = AnimTime >= 0
value = 0
ctrl = 1
; --- Landing ---
[Statedef 4922]
type = S
movetype = I
physics = C
anim = 47
velset = 0,0
sprpriority = 2
ctrl = 0
;facep2 = 1

[State 4922, 0]
type = PosSet
trigger1 = 1
y = 0

[State 4922, EnterAgain]
type = ChangeAnim
trigger1 = BackEdgeBodyDist <= 0
value = 100

[State 4922, vel]
type = VelSet
trigger1 = BackEdgeBodyDist <= 0
x = 9

[State 4922, invin]
type = NotHitBy
trigger1 = BackEdgeBodyDist <= 0
value = SCA
time = 4

; Partner Assist behavior option: Define this one if you want... ^_^
; PARTNER ASSIST - the character attacks his opponent when :
[State 4922, Strike!] 
type = ChangeState
triggerall = BackEdgeBodyDist > 0
triggerall = partner, life > 0
triggerall = Pos y >= 0      
triggerall = !Win && !Lose
trigger1 = prevstateno = 4908
trigger2 = var(51) = 8
value = 4933
;value = 4905				; <---|	 ..use this value for non-projectile(or close range) Partner Assist move attack.

; TEAM HYPER ATTACK - the character attacks his opponent when :
[State 4922, RockEnRoll]
type = tagin
trigger1 = partner, stateno = 4925 && partner, Statetime > 0
trigger1 = partner, life > 0
trigger1 = Pos y >= 0       
trigger1 = !Win && !Lose
stateno = 4932
partnerstateno = 4931

[State 4922, interrupt]
type = ChangeState
triggerall = partner, var(51)= 2
trigger1 = partner, stateno != [2000,4933]
value = 4932
ctrl = 0

[State 4922, invin]
type = NotHitBy
trigger1 = var(51) != 8
trigger2 = Partner, var(51) = 6
value = SCA
time = 6

[State 4922, end]
type = ChangeState
triggerall = var(51) != 8
trigger1 = Anim = 100
trigger1 = backedgebodydist > 0
trigger2 = Anim != 100
trigger2 = AnimTime >= 0
value = 0
ctrl = 1

; Activate Team Hyper Combo - Standby (onscreen)
[Statedef 4925]
type = S
movetype = U
physics = S
sprpriority = -2
velset = 0,0
hitdefpersist = 1
hitcountpersist = 1
ctrl = 0

[State 4925, taunt]
type = ChangeAnim
trigger1 = time = 1
value = 195			; <---|[TAUNT]
persistent = 0

[State -2, def]
type = VarSet
trigger1 = time = [0,1]
v = 51
value = 2

[State 4925, PartnerPause]
type = Superpause
trigger1 = NumTarget && Time = [0,1]
anim = -1
time = 6
movetime = 6
darken = 0

[State 4925, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4925, ghost] 
type = PlayerPush
trigger1 = 1
value = 1

[State 4925, UnoLoveSheForever]
type = ChangeState
trigger1 = partner, Anim = [5000,5500]
trigger2 = !partner, stateno = [1000,4933]
value = 4932
ctrl = 0

[State 4925, end]
type = ChangeState
trigger1 = partner, prevstateno = [4932,4931]
trigger2 = partner, prevstateno = 4901
trigger3 = !partner, prevstateno = 4901
trigger3 = animtime = 0
value = 4911


; Activate Change Attack
[Statedef 4926] 
type = U
movetype = U
physics = U
sprpriority = -3
velset = 0,0
ctrl = 0
hitdefpersist = 1
movehitpersist = 1
hitcountpersist = 1

[State -2, def]
type = VarSet
trigger1 = Time = [0,1]
v = 51
value = 3

[State 4926, TargetFace]
type = TargetFacing
trigger1 = Numtarget
value = -1

[State 4926, Override1]
type = TargetState
triggerall = NumTarget
triggerall = Time = [0,1]
trigger1 = Target, StateNo != [5000,5500]
trigger1 = !(Target, StateNo = [120,152]) && !(Target, Anim = [120,152])
trigger1 = Target, Pos Y > -10 || (Target, Pos Y >= -25 && Target, StateNo != [4915,5500])
value = 4917
ignorehitpause = 1

[State 4926, Override2]
type = TargetState
triggerall = Time = 0
triggerall = NumTarget
trigger1 = !(Target, StateNo = [120,152]) && !(Target, Anim = [120,152]) && !(Target, StateNo = [4916,4919])
trigger1 = Target, Pos Y < -25 
trigger1 = Target, Statetype = A
trigger1 = Target, StateNo != [5000,5500]
value = 4919
ignorehitpause = 1

[State 4926, PartnerPause]
type = Superpause
trigger1 = time = [1,2]
anim = -1
time = 3
movetime = 2
p2defmul = 1
darken = 0

[State 4926, TargetVelOnFloor]
type = TargetVelSet
triggerall = NumTarget > 0
trigger1 = !(Target, StateNo = [4916,4919]) && !(Target, PrevStateNo = [4916,4918])
trigger1 = Target, StateType != A && Target, StateType != L
x = 0.1

[State 4926, TargetVelOnAir]
type = TargetVelSet
triggerall = Numtarget > 0
trigger1 = (Target, StateNo != [4916,4919]) && (Target, PrevStateNo != [4916,4918])
trigger1 = (Target, Pos Y <= -6) ; || (Target, Pos Y > -6 && target, GetHitVar(yvel) < 1)
trigger1 = Target, Statetype = A
trigger1 = Target, MoveType = H
y = -6.5
persistent = 0

[State 4926, RemoveExplod]
type = RemoveExplod
trigger1 = 1

[State 4926, AfterImageTime]
type = Null
trigger1 = 1
time = 0

[State 4926, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4926, ghost] 
type = PlayerPush
trigger1 = 1
value = 0

[State 4926, STS]
type = StateTypeSet
trigger1 = partner, stateno = 4901
trigger1 = Partner, Backedgebodydist >= 0
movetype = I
physics = N
persistent = 1

[State 4926, SprPrior]
type = SprPriority
trigger1 = partner, stateno = 4901
value = -3

[State 4926, VelSet]
type = VelSet
trigger1 = partner, stateno = 4901
trigger1 = Partner, Backedgebodydist >=0
x = 0
y = 0

[State 4926, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = F799,0

[State 4926, end round]
type = ChangeState
trigger1 = RoundState > 2
value = 0

[State 4926, end state]
type = ChangeState
triggerall = stateno != 4912
triggerall = RoundState = 2
triggerall = time > 1
trigger1 = partner, stateno = 4902
trigger2 = partner, stateno != 4912
trigger3 = animtime = 0
value = 4911
ignorehitpause = 1


; Tag Hyper Cancel
[Statedef 4927]
type = U
movetype = A
physics = U
sprpriority = -3
velset = 0,0
ctrl = 0
hitdefpersist = 1
movehitpersist = 1
hitcountpersist = 1

[State -2, def]
type = VarSet
trigger1 = time = [0,1]
v = 51
value = 4

[State 4927, TargetFace]
type = TargetFacing
trigger1 = Numtarget
value = -1

; Modify this one! - add names of grappler-type characters you have with hyper throw moves.
[State 4927, TargetGrappler]
type = TargetState
triggerall = Time = [0,1]
triggerall = NumTarget
triggerall = !(Target, StateNo = [120,152]) && !(Target, Anim = [120,152])
triggerall = Target, Pos Y > -110 && (Target, statetype = A || Target, statetype = L || Target, StateNo != [4916,5500])
trigger1 = Partner, Name = "Mature"
trigger2 = Partner, Name = "clark" || Partner, Name = "Clark" || Partner, Name = "Clark Steele"
trigger3 = Partner, Name = "ViceXIII" || Partner, Name = "Vice"
trigger4 = Partner, Name = "Goro Daimon"
trigger5 = Partner, Name = "Zangief" || Partner, Name = "zangief" || Partner, Name = "cvszangief"
;trigger6 = Partner, Name = ""		; <---| ..add name here(or you can add more, just follow the last trigger#)
value = 4916
ignorehitpause = 1

[State 4927, Override]
type = TargetState
triggerall = Time = 0
triggerall = NumTarget
triggerall = !(Target, StateNo = [120,152]) && !(Target, Anim = [120,152]) && !(Target, StateNo = [4916,4919])
triggerall = Target, Pos Y > -25 
trigger1 = Target, Statetype = A || Target, statetype = L || Target, Anim = [5000,5210]
trigger2 = Target, StateNo != [5000,5500]
value = 4917
ignorehitpause = 1

[State 4927, Override2]
type = TargetState
triggerall = Time = 0
triggerall = NumTarget
triggerall = !(Target, StateNo = [120,152]) && !(Target, Anim = [120,152]) && !(Target, StateNo = [4916,4919])
triggerall = Target, Pos Y <= -25 
trigger1 = Target, Statetype = A
trigger1 = Target, StateNo != [5000,5500]
value = 4919
ignorehitpause = 1

[state 4927, labo]
type = Null
trigger1 = 1
trans = addalpha
alpha = 150,100

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = (GameTime % 2) = 1
flag = invisible

[State 4927, AfterImageTime]
type = Null
trigger1 = 1
time = 0 

[State 4927, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4927, ghost] 
type = PlayerPush
trigger1 = 1
value = 0

[State 4927, sb] 
type = ScreenBound
trigger1 = 1
value = 0

[State 4927, TargetVelOnAir]
type = TargetVelAdd
triggerall = Numtarget > 0
triggerall = (Target, StateNo != [4916,4918]) && (Target, PrevStateNo != [4916,4918])
trigger1 = Target, Statetype = A
trigger1 = Target, MoveType = H
trigger1 = Target, Pos Y < -20 && target, GetHitVar(yvel) < -0.7
y = 0.7

[State 4927, SprPriority]
type = SprPriority
trigger1 = partner, stateno = 4931
trigger2 = partner, stateno = 4901
value = -3

[State 4927, VelSet]
type = VelSet
trigger1 = partner, stateno = 4931
trigger2 = partner, stateno = 4901
x = 0
y = 0

[State 4927, end round]
type = ChangeState
trigger1 = RoundState > 2
value = 0

[State 4927, end state]
type = ChangeState
triggerall = stateno != 4912
triggerall = RoundState = 2
triggerall = time > 1
trigger1 = partner, prevstateno = 4931
trigger2 = !partner, prevstateno = 4931
trigger2 = animtime = 0
trigger3 = statetime > 12
value = 4912


; --- Uno Mode: Initialize ---
[Statedef 4928] 
type = S
movetype = I
physics = S
anim = 195			; <---|[TAUNT]
sprpriority = 5
velset = 0,0
ctrl = 0

[State 4928, invin]
type = NotHitBy
trigger1 = 1
value = SCA
time = 2

[State 4928, ghost] 
type = PlayerPush
trigger1 = 1
value = 0

[State 4928, PosFreeze]
type = PosFreeze
trigger1 = 1
value = 1

[State 4928, end]
type = TagIn
trigger1 = Time = [3,4]
stateno = 4929
partnerstateno = 4906


; --- Uno Mode: Harakiri ---
[Statedef 4929] 
type = S
movetype = I
physics = S
anim = 5300
sprpriority = 5
velset = 0,0
poweradd = -(power)
ctrl = 0

[State -2, def]
type = Null	;VarSet
trigger1 = time = [0,1]
v = 51
value = 6

[State 4929, helper]
type = helper
trigger1 = Time = [0,1]
helpertype = Normal
ID = 4930
stateno = 4930
name = "Tigok"
ownpal = 0
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4929, SuperPause]
type = SuperPause
trigger1 = Partner, StateNo = 4906
time = 10
anim = 100
sound = -1
movetime = 10
darken = 0
p2defmul = 0
unhittable = 1
pausebg = 1

[State 4929, EndLife]
type = LifeAdd
trigger1 = Time > 0
trigger2 = Partner, Life <= 0
value = -LifeMax

[State 4929, End]
type = ChangeState
trigger1 = Time > 0
trigger1 = Partner, StateNo = 4906
value = ifelse(selfAnimExist(5130),5130,5950)
ctrl = 0
persistent = 0


; --- Uno Mode: Super Helper ---
[Statedef 4930] 
type = S
movetype = I
physics = S
anim = 5150
velset = 0,0
ctrl = 0

[State 4930, tago]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow
ignorehitpause = 1

[State 4930, dark]
type = BgPalFx
trigger1 = IsHelper(4939)
time = 9
mul = Time,Time,Time

[State 4930, sb]
type = ScreenBound
trigger1 = 1
value = 0

[State 4930, invin]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4930, End]
type = destroySelf 
trigger1 = IsHelper(4930)
trigger1 = Root, StateNo = [5110,5150]

[State 4930, End]
type = destroySelf 
trigger1 = IsHelper(4939)
trigger1 = Time >= 256




; **************************
; ** user-defined section **
; **************************

; Tag Hyper Cancel Move selection
;-----------------------------------------
[Statedef 4931]
type = S
movetype = A
physics = S
sprpriority = 2
ctrl = 0
;facep2 = 1

[State 4931, pos]
type = PosSet
triggerall = PrevStateNo != 4925
trigger1 = Time = 0
x = (enemynear, pos x + ifelse((enemynear, facing = 1),60,-60))
y = 0

[State 4931, StayClose]
type = PosAdd
trigger1 = PrevStateNo != 4925
x = ((p2BodyDist x) * 0.9)
persistent = 0

; Activate this one if you wish the character to do an aerial-super move.
; ..you can also use(by removing the preceeding ";") either of trigger conditions below depending on what will fit to your characters super-move behavior.
[State 4931, AirState]
type = NULL; PosAdd	 		; <---| Remove the NULL; to activate this code. 
triggerall = PrevStateNo != 4925
trigger1 = time = [0,1]
;trigger1 = enemynear, statetype = A
;trigger1 = enemynear, statetype != A
;trigger1 = P2Dist Y <= -25
y = (5 + (abs(enemynear, pos Y)/2)) * -1		; <---| change "5" with a higher value if wish your character to appear higher(above in front of the opponent).
persistent = 0

[State 4931, sb] 
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 4931, helper]
type = helper
trigger1 = time = 1
helpertype = Normal
ID = 4901
stateno = 4901
name = "Cancel"
ownpal = 0
supermovetime = 9999
pausemovetime = 9999
persistent = 0

[State 4931, Assert]
type = AssertSpecial
triggerall = PrevStateNo != 4925
trigger1 = NumHelper(4901)
trigger2 = Time = [0,1]
flag = invisible
flag2 = noshadow
ignorehitpause = 1

[State 4931, VarSet]
type = VarSet
trigger1 = !Time
var(54) = 1 

[State 4931, VarSet]
type = VarSet
trigger1 = !Time
var(5) = 0 

; - Define this one!
[State 4931, Anti-Air_HyperMove]
type = ChangeState
triggerall = !NumHelper(4901)
triggerall = PrevStateNo != 4925
trigger1 = Enemynear, Pos Y <= -25 || enemynear, statetype = A
trigger1 = P2Dist x = [0,100]
trigger1 = Time > 0
trigger1 = selfAnimExist(3000)	; <---| change this..
value = 3050       		; <---| ..and this for the Lv.1 Anti-air or Aerial Super move. 

; - Define this one!
[State 4931, HyperMove]
type = ChangeState
triggerall = !NumHelper(4901)
trigger1 = PrevStateNo = 4925 || Time > 0
trigger1 = selfAnimExist(3000)	; <---| change this..
value = 3050       		; <---| ..and this for the Lv.1 Super move. 

[State 4931, end state] ; cancel if:
type = Changestate
trigger1 = !NumHelper(4901)
trigger1 = PrevStateNo = 4925 || Time > 0
value = 0
ctrl = 1


; Team Hyper Attack Move selection
;-----------------------------------------
[Statedef 4932]
type = S
movetype = I
physics = S
sprpriority = 2
ctrl = 0

; - Define this one!
[State 4932, LV3_HyperMove]
type = ChangeState
trigger1 = time = [0,1]
trigger1 = selfAnimExist(3000)	; <---| change this (or you can erase this line if you modify the value and put an existing hyper-move state)..
value = 3000       		; <---| ..and this for the Lv.3/Lv.2 Super move. (modify but never delete this line!)

[State 4932, end state] ; cancel if:
type = ChangeState
trigger1 = Time = [0,1]
value = 0
ctrl = 1


; Partner Assist - Striker Moves
;-----------------------------------------
[Statedef 4933]
type = S
movetype = A
physics = S
sprpriority = 2
;poweradd = - 100
ctrl = 0

[State 4933, EnterAgain]
type = ChangeAnim
trigger1 = BackEdgeBodyDist <= 0
value = 100
persistent = 0

[State 4933, vel]
type = VelSet
triggerall = BackEdgeBodyDist <= 0
trigger1 = Anim != 4933
x = 10.5

[State 4933, vel2]
type = VelSet
triggerall = BackEdgeBodyDist >= 0
trigger1 = Anim = 4933
trigger1 = AnimElem = 2, >= 0
x = 8

[State 4933, sb] 
type = ScreenBound
trigger1 = 1
value = 0

; - Define this one!
[State 4933, Anti-Air SpecialMove] 
type = Null
triggerall = BackEdgeBodyDist > 0
trigger1 = P2Dist Y <= -17 ;|| enemynear, statetype = A
trigger1 = P2Dist x = [-50,70]
trigger1 = selfAnimExist(1100)	; <---| change this..
value = 1100       		; <---| ..and this for the Anti-air Partner Assist move. 

; - Use this one for another option of moves(attack-move for opponent lying down)
[State 4933, LyingDown_SpecialMove] 
type = NULL; ChangeState			; <---| Remove the NULL; to execute this code
triggerall = BackEdgeBodyDist > 0
trigger1 = P2Dist x = [-50,55]
trigger1 = enemynear, StateType = L
trigger1 = selfAnimExist(1000)	; <---| change this..
value = 1000       		; <---| ..and this for the Partner Assist move. 

; - Define this one!
[State 4933, SpecialMove] 
type = ChangeState
triggerall = BackEdgeBodyDist > 0
triggerall = PrevStateNo = 4921
trigger1 = selfAnimExist(1000)	; <---| change this..
value = 1000       		; <---| ..and this for the Partner Assist move. 

[State 4933, SpecialMove] 
type = ChangeState
triggerall = PrevStateNo = 4922
triggerall = BackEdgeBodyDist > 0
trigger1 = selfAnimExist(1100)	; <---| change this..
value = 1100       		; <---| ..and this for the Partner Assist move. 


[State 4933, end state] ; cancel if:
type = Changestate
trigger1 = Time = [0,1]
value = ifelse((Partner, Alive), 4910, 0)
ctrl = ifelse((Partner, Alive), 0, 1)

; - Mabuhay ang Pinoy!!!

